# Original credit: https://gitee.com/wx-rdc/docker-fwknop

# full features image
FROM ubuntu:20.04

LABEL maintainer="Edward Zhu <zhuhy163@163.com>"

RUN apt-get update && apt-get -y install gcc automake autoconf libtool make build-essential libpcap-dev iptables

COPY ./src /app

WORKDIR /app

# 编译脚本
RUN ./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc --with-firewalld=no && make && make install && ldconfig

VOLUME ["/etc/fwknop"]

# Internally uses port 62201/udp
EXPOSE 62201/udp

CMD ["fwknopd", "-f"]

# scripts
ADD ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/*
